Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KdTree nearestNeighbor() and nearestNeighbors() #1114

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

micycle1
Copy link
Contributor

@micycle1 micycle1 commented Jan 27, 2025

Implement #758.
added a getNodes() too, and a few other minor touch ups.

@micycle1 micycle1 changed the title add KDtree nearestNeighbor() and nearestNeighbors() Add KdTree nearestNeighbor() and nearestNeighbors() Jan 27, 2025
KdTree tree = new KdTree();
Random rand = new Random();

List<Coordinate> points = new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done in the startRun method.


Coordinate query = new Coordinate(rand.nextDouble(), rand.nextDouble());

// Time k-NN query using k-d tree
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two tests can be done in runXXX methods, so they are run and timed by the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants